package com.gjy.pulsar.util;

import org.apache.pulsar.client.api.PulsarClient;
import org.apache.pulsar.client.api.PulsarClientException;

/**
 * @author gjy
 * @version 1.0
 * @since 2025-08-02 10:14:28
 */
public class PulsarUtil {

    //private static final String URL = "pulsar://192.168.253.142:6650/";
    public static final String ADMIN_URL = "http://localhost:8080/";
    public static final String URL = "pulsar://localhost:6650/";

    public static final String MY_TOPIC = "my_topic";
    public static final String MY_TOPIC2 = "persistent://public/default/my_topic2";

    public static PulsarClient getClient() {
        try {
            return PulsarClient.builder().serviceUrl(URL).build();
        } catch (PulsarClientException e) {
            throw new RuntimeException(e);
        }
    }

}
